import { BASE } from '../api'
import { METHOD, request } from '@/utils/request'

// 新增考核事件
export async function addEvent(params) {
    return request(`${BASE}/event/save`, METHOD.POST, params)
}

// 删除考核事件
export async function delEvent(params) {
    return request(`${BASE}/event/del`, METHOD.POST, params)
}

// 更新考核事件
export async function eventUpdate(params) {
    return request(`${BASE}/event/update`, METHOD.POST, params)
}

// 考核事件查询
export async function getEventList(params) {
    return request(`${BASE}/event/page`, METHOD.POST, params)
}

// 获取考核事件详情
export async function getEventDetail(params) {
    return request(`${BASE}/event/get`, METHOD.POST, params)
}

// 条例查询
export async function getAllRegulation(params) {
    return request(`${BASE}/regulation/query`, METHOD.POST, params)
}

// 部门查询
export async function getAllDept() {
    return request(`${BASE}/department/query`, METHOD.POST, {})
}

// 支部查询
export async function getAllBranch(params) {
    return request(`${BASE}/branch/query`, METHOD.POST, params)
}

// 获取整改详情
export async function rectifiGet(params) {
    return request(`${BASE}/event/correct/get`, METHOD.POST, params)
}

// 整改
export async function rectification(params) {
    return request(`${BASE}/event/correct`, METHOD.POST, params)
}

// 审批
export async function approve(params) {
    return request(`${BASE}/event/approve`, METHOD.POST, params)
}

export default {
    addEvent,
    delEvent,
    eventUpdate,
    getEventDetail,
    getEventList,
    getAllDept,
    getAllBranch,
    getAllRegulation,
    rectifiGet,
    rectification,
    approve
}